<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 1. 指定一个容器(box)采用网格布局。容器的直接子元素(item)为项目 */
    .box {
      display: grid;
    }
    /* 2. 使用grid的同时将元素设置为行内元素 */
    .box {
      display: inline-grid;
    }
  </style>
</head>
<body>
  <span>foo</span>
  <div class="box">
    <div class="item"><p>1</p></div>
    <div class="item"><p>2</p></div>
    <div class="item"><p>3</p></div>
  </div>
  <span>bar</span>
</body>
</html>